﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NMemcached.Client
{
    /// <summary>
    /// Defines methods required to serialize and deserialize to and from a sequence of bytes
    /// </summary>
    public interface ISerializer
    {
        /// <summary>
        /// Serializes an object into a sequence of bytes
        /// </summary>
        /// <param name="data">The data to serialize</param>
        /// <returns>The serialized object as a sequence of bytes</returns>
        byte[] Serialize(object data);

        /// <summary>
        /// Deserializes a sequence of bytes into a collection of objects
        /// </summary>
        /// <param name="data">The sequence of bytes to deserialize</param>
        /// <returns>A collection of objects deserialized from the sequence of bytes</returns>
        IEnumerable<object> Deserialize(byte[] data);
    }
}
